<?php
namespace Wap\Model;
use Think\Model;
use Think\Model\RelationModel;
class RentalModel extends RelationModel {
    //关联关系
    protected $_link = array(
        'RentalCate'=>array(
            'mapping_type'=>self::BELONGS_TO,
            'foreign_key'=>'cate_id',
            'mapping_fields'=>'name',	//要取出的字段
            'as_fields'=>'name:cate_name'	//使用别名
        )
    );
}